]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
magnifier: Remove needless actor
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 28 Jun 2021 16:06:47 +0000 (18:06 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 28 Jun 2021 18:53:57 +0000 (20:53 +0200)
For the pointer clone, we actually have 2 actors (one that contains
the sprite, another that moves around). These can just be the same.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1902>

js/ui/magnifier.js

index c8f695e2b69c5f12a5e6eac9665bbc7fcbae747e..2f0a279a2897c5cfac6bdee8632b3bad69a5c3d7 100644 (file)
@@ -99,15 +99,12 @@ var Magnifier = class Magnifier {
         this._mouseSprite = new Clutter.Actor({ request_mode: Clutter.RequestMode.CONTENT_SIZE });
         this._mouseSprite.content = new MouseSpriteContent();
 
-        this._cursorRoot = new Clutter.Actor();
-        this._cursorRoot.add_actor(this._mouseSprite);
-
         // Create the first ZoomRegion and initialize it according to the
         // magnification settings.
 
         [this.xMouse, this.yMouse] = global.get_pointer();
 
-        let aZoomRegion = new ZoomRegion(this, this._cursorRoot);
+        let aZoomRegion = new ZoomRegion(this, this._mouseSprite);
         this._zoomRegions.push(aZoomRegion);
         this._settingsInit(aZoomRegion);
         aZoomRegion.scrollContentsTo(this.xMouse, this.yMouse);
@@ -269,7 +266,7 @@ var Magnifier = class Magnifier {
      * @returns {ZoomRegion} the newly created ZoomRegion.
      */
     createZoomRegion(xMagFactor, yMagFactor, roi, viewPort) {
-        let zoomRegion = new ZoomRegion(this, this._cursorRoot);
+        let zoomRegion = new ZoomRegion(this, this._mouseSprite);
         zoomRegion.setViewPort(viewPort);
 
         // We ignore the redundant width/height on the ROI